package cn.iocoder.yudao.module.infra.service.oss.config;

import cn.iocoder.yudao.module.infra.oss.factory.OssFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
@EnableConfigurationProperties(OssConfigProperties.class)
public class OssConfiguration {
    @Resource
    OssConfigServiceImpl ossConfigService;

    @Bean
    public OssFactory ossUtils() {
        ossConfigService.init();
        return new OssFactory();
    }
}
